On a profile without recently-used.xbel, taking a screenshot saves the PNG
but does not add it to recent files. GLib.BookmarkFile.load_from_file()
reports a missing file as GLib.FileError.NOENT, while the handler checked
GLib.BookmarkFileError.FILE_NOT_FOUND and returned.
Fixes: b89d90eb80 ("screenshot: Use GLib.BookmarkFile to save recent screenshots")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4405>
(cherry picked from commit
fa82d28c3b0dcfd27e49bac291b37b5ca9237dc7)
try {
bookmarks.load_from_file(recentFile);
} catch (e) {
- if (!e.matches(GLib.BookmarkFileError, GLib.BookmarkFileError.FILE_NOT_FOUND)) {
+ if (!e.matches(GLib.FileError, GLib.FileError.NOENT)) {
log(`Could not open recent file ${uri}: ${e.message}`);
return;
}